//全选
;(function(){
	var btn = document.querySelector('.submitcar-all');
	var checks = document.querySelectorAll('.carlist .carlist-check');
	var flag = false;
	btn.addEventListener('tap',function(){
			if(flag){
				for(var i=0,j=checks.length;i<j;i++){
					checks[i].removeAttribute('checked');
				}
				flag = false;
			}else{
				for(var i=0,j=checks.length;i<j;i++){
					checks[i].setAttribute('checked','');	
				}
				flag = true;
		}
	});
})();
//付款
;(function(){
	var click = document.querySelectorAll('.submitcar-btn');
	var buyWin = document.querySelector('.showpay-mask');
	var showPay = document.querySelector('.showpay-area');
	var closePay = document.querySelector('.closepay');
	for(var i=0,j=click.length;i<j;i++){
		click[i].addEventListener('tap',clickBuy);
	}
	closePay.addEventListener('tap',clickBuy);
	function clickBuy(e){
		buyWin.style.display = buyWin.style.display == 'none' ? 'block' : 'none';
		setTimeout(function(){
			showPay.style.bottom = parseInt(showPay.style.bottom) < 0 ? 0 : -90 + 'vh';
		})
		
	}
})();